<template>
  <div class="container">
    <ModelBlock :list="list" :level="1" ref="block"></ModelBlock>
  </div>
</template>

<script>
import ModelBlock from "./ModelBlock";
import { deepClone } from "@/utils/index";
export default {
  name: "TreeMoel",
  props: {
    tree: {
      type: Array,
      default: () => [],
    },
  },
  components: {
    ModelBlock,
  },
  data() {
    return {
      list: [],
    };
  },
  created() {
    this.list = deepClone(this.tree);
  },
  methods: {
    getData() {
      return this.list;
    },
    addChildren() {
      this.$refs.block.addChildren();
    },
  },
};
</script>
<style lang="scss" scoped></style>
